import requests

class LoGin:
    def __init__(self):
        self.session = requests.session()
        self.url = "http://nkoapi.xsit.kaikela.cn/api"

    def loGin(self,json):
        res = self.session.post(self.url,json=json)
        print(res.json())

# 账号密码登陆
json_user_pwd = {
    "service_name": "nkobase.SSOProvider.SignByPwd",
    "param": {
       "accName":"koyunying",
       "userName":"yyf001",
       "password":"123456"
    }
}

# 获取验证码
json_getcode = {
    "service_name": "nkobase.SSOProvider.GetCaptchaMsg",
    "param": {
        "accName": "约定好的accName",
        "phone": "13221085986"
    }
}
# code =
# // 校验验证码，并获取token
json_checkcode = {
    "service_name": "nkobase.SSOProvider.CheckCaptchaAndLogin",
    "param": {
    "phone": "18790680222",
    "code": "115818"
    }
}
login = LoGin()
login.loGin(json_getcode)

